<?php 
$province_id = empty($province_id) ? $this->input->get("province") : $province_id;
$city_id = empty($city_id) ? $this->input->get("city") : $city_id;
$area_id = empty($area_id) ? $this->input->get("area") : $area_id;
?>
<?php echo form_dropdown('province', $provinces, $province_id, 'class="province"');?>
<select name="city" class="city" id="city-selector">
	<option value="">城市</option>
</select>
<select name="area" class="area" id="area-selector">
	<option value="">区 / 县</option>
</select>
<script type="text/javascript">
$(document).ready(function(){
<?php if (!empty($province_id)) {?>
set_cities("<?php echo $province_id;?>", $("#city-selector"),"<?php echo $city_id;?>", 0);
<?php }?>
<?php if (!empty($city_id)) {?>
set_areas("<?php echo $city_id;?>", $("#area-selector"),"<?php echo $area_id;?>");
<?php }?>
});
</script>